
 class Vehicle{
         double getMoney();
     }

     class Truck extends Vehicle{
         double load;
         public Truck(double load) {
             this.load=load;
         }

         public double getMoney() {
             return 1000*this.load;
         }

     }

     class Keche extends Vehicle{
         int seat;
         public Keche(int seat) {
             this.seat=seat;
         }

         public double getMoney() {
             return 50*this.seat;
         }
     }

     class Car extends Vehicle{
         int level;
         int year;

         public Car(int level,int year) {
             this.level=level;
             this.year=year;
         }

         public double getMoney() {
             return 200*this.level/(Math.sqrt(this.year));
         }
     }

     class CarRentCompany{
         public static double rentVehicles(Vehicle[] vs) {
             double sum=0;
             for(int i=0;i<vs.length;i++) {
                 sum+=vs[i].getMoney();
             }
             return sum;
         }
     }


